package cn.jg.framework.common.service;

import java.util.Optional;

/**
 * @author fanfever
 * @date 2016/7/9
 */
public interface BaseService<P, E> {

	Optional<E> findById(final P id);

	default boolean isPresent(final P id) {
		return findById(id).isPresent();
	}

	E save(final E model);

	E update(final E model);

	void delete(final P id);

}
